/**
  *****************************************************************************
  * @file 
  * @brief 
  * @author  Moon
  * @version
  * @date    2022/09/02
  *****************************************************************************
  */
#ifndef __DEV_FM24CLXX_H
#define __DEV_FM24CLXX_H

#include "dev_include.h"

/* Public defines -----------------------------------------------------------*/
#define DEV_FM24_VERSION				"V0.0.2"

/* private config -----------------------------------------------------------*/

/* Public Struct ------------------------------------------------------------*/
typedef struct
{
    drv_i2c_t i2c;
    drv_gpio_t gpio_wp;
} fm24clxx_private_t;

typedef struct dev_fm24 dev_fm24_t;

struct dev_fm24
{
    /* ***************Public Parameter  *************** */
    const char *PIN_SCL;    //I2C时钟线-引脚
    const char *PIN_SDA;    //I2C数据线-引脚
	
    const char *PIN_WP;     //写保护-引脚

    uint16_t   chip_size;   //芯片内存（FM24CL16：2048  FM24CL64：8192）
    /* ***************Public Method     *************** */
    uint16_t    ( *Write )  ( dev_fm24_t *, uint16_t writeaddr, uint8_t* data, uint16_t len);
    uint16_t    ( *Read  )  ( dev_fm24_t *, uint16_t readaddr,  uint8_t* data, uint16_t len);
    int         ( *Check )  ( dev_fm24_t *);

    /* ***************Private Attributes*************** */
    fm24clxx_private_t private;
};

/* Public enum --------------------------------------------------------------*/

/* Public Variable ----------------------------------------------------------*/
//Pointer

//Array

//Const


/* Pubilc function prototypes -----------------------------------------------*/
int Dev_Fm24_Init(dev_fm24_t *this);



#endif /* __DEV_FM24_H */
